<% if current_user %>
  <a href="<%= notifications_path %>" class="dropdown nav-notifications nav-link mr-2 <%= unread_notifications_count > 0 ? "unread" : "" %>">
    <%= icon_tag "bell" %>
  </a>

  <div class="dropdown">
    <%= icon_tag("new") %>
    <div class="dropdown-menu dropdown-menu-sw">
      <ul>
        <% if @user %>
        <li><a class="dropdown-item" href="<%= main_app.new_repository_path(user_id: @user.id) %>"><%= t(".New Repository") %></a></li>
        <% else %>
        <li><a class="dropdown-item" href="<%= main_app.new_repository_path %>"><%= t(".New Repository") %></a></li>
        <% end %>

        <% if @user %>
        <li><a class="dropdown-item" href="<%= main_app.import_repository_path(user_id: @user.id) %>"><%= t(".Import Repository") %></a></li>
        <% else %>
        <li><a class="dropdown-item" href="<%= main_app.import_repository_path %>"><%= t(".Import Repository") %></a></li>
        <% end %>
        <li class="dropdown-divider"></li>
        <li><a class="dropdown-item" href="<%= main_app.new_note_path %>"><%= t(".New Note") %></a></li>
        <li class="dropdown-divider"></li>
        <li><a class="dropdown-item" href="<%= main_app.new_group_path %>"><%= t(".New Group") %></a></li>
      </ul>
    </div>
  </div>

  <div class="dropdown">
    <%= user_avatar_tag(current_user, style: "tiny", link: false) %>
    <div class="dropdown-menu dropdown-menu-sw">
      <div class="dropdown-header">
        <%= current_user.name %>
      </div>
      <ul>
        <li><a class="dropdown-item" href="<%= current_user.to_path %>"><%= t(".Your profile") %></a></li>
        <li class="dropdown-divider"></li>
        <li><a class="dropdown-item" href="<%= current_user.to_path("?tab=repositories") %>"><%= t(".Your repositories") %></a></li>
        <li><a class="dropdown-item" href="<%= current_user.to_path("/notes") %>"><%= t(".Your notes") %></a></li>
        <% if current_user.admin? %>
        <li class="dropdown-divider"></li>
        <li><a class="dropdown-item" href="<%= main_app.admin_root_path %>"><%= t(".Admin Panel") %></a></li>
        <% end %>
        <li class="dropdown-divider" role="separator"></li>
        <li><a class="dropdown-item" href="<%= main_app.account_settings_path %>"><%= t(".Settings") %></a></li>
        <li><a class="dropdown-item" href="<%= main_app.destroy_user_session_path %>" data-method="delete"><%= t(".Sign out") %></a></li>
      </ul>
    </div>
  </div>
<% else %>
  <%= link_to t(".Sign in"), main_app.new_user_session_path, class: "nav-link mr-3" %>
  <%= link_to t(".Sign up"), main_app.new_user_registration_path, class: "nav-link" %>
<% end %>